﻿using Serilog;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GameServer.Battle
{
    public class Attribute
    {
        private AttributeData Basic;
        private AttributeData Equip;
        private AttributeData Buffs;
        private AttributeData Final;
        public void Init(CharacterMessage define,int level)
        {
            Basic=new AttributeData();
            Equip=new AttributeData();
            Buffs=new AttributeData();
            Final=new AttributeData();
            //初始属性
            var Initial = new AttributeData();
            Initial.Hp = define.hp;
            Initial.Mp=define.mp;
            Initial.Attack = define.attack;
            Initial.Magic = define.magic;
            Initial.Defense = define.defense;
            Initial.MagicDefense = define.magicdefense;
            Initial.Speed = define.speed;
            Initial.Baoji = define.baoji;
            Initial.BaojiDefense = define.baojidefense;

            //成长属性
            var Growth=new AttributeData();

            Basic.Merge(Initial);
            Basic.Merge(Growth);

            Final.Merge(Basic);
            Final.Merge(Equip);
            Final.Merge(Buffs);
            //Log.Information("初始属性:{0}",Initial);
            //Log.Information("成长属性:{0}", Growth);
            //Log.Information("装备属性:{0}", Equip);
            //Log.Information("Buff属性:{0}", Buffs);
            Log.Information("最终属性:{0}", Final);
        }
    }
}
